Release 10.1A: OpenEdge Development:
Programming Interfaces
Client-principal objects
If you use the OpenEdge internal authentication system (see the "Authenticating OpenEdge internal user IDs and passwords" section) to authenticate and set a database connection ID, the specified database authorizes access according to this user ID. Also, by default, with auditing enabled, the database records audit events associated with this user ID. However, no other information about the user session is maintained for later review.
If you use your own external authentication system to authenticate user IDs for your application, you might still have to authenticate a database connection ID (the same or different from the Progress session ID) in order to obtain authorization to connect to a given database. The database connection ID, whatever it is, continues to be the auditing ID, for any audit events that your application generates. And, there is no information about the application user session maintained for later review, except what is associated with the database connection ID.
A client-principal object allows you to establish a client login session for a given user ID, no matter how you authenticate that ID. A client login session is a run-time construct that can be in any one of several states, indicated by the
LOGIN-STATEandSTATE-DETAILattributes on the client-principal object handle. These states are controlled by methods and other attribute settings of the client-principal object handle. Such states include whether the session is logged in or out, or has been suspended, expired, or otherwise failed. Thus, the client-principal object, provides the following application features:
- Maintains a run-time client login session that can be optionally recorded in an OpenEdge RDBMS and also as part of an audit trail if auditing is enabled and auditing policies for the database permit.
- Contains a variety of information about the client login session, such as the user ID, a description of the authentication system (domain), a description of the login environment, the state of the login session, a unique identifier for the session, and other information, some of which are optional, depending on how you use the client-principal object.
- Can be used to assert and validate a user ID against a trusted domain registry, and there by set a particular type of identity from that user ID according to the type of domain registry (database or application) and associated database option settings.
- Can be exported and imported to transport a user identity between different 4GL session contexts in the same application environment.
With all of its features, the ultimate purpose of a client-principal object is to enable your application to authenticate a user ID once and set that same ID many times, in many different places, thus achieving the goal of single sign-on for your entire application.
Client-principal object attributes
The client-principal object provides several attributes that you can set for various functional and informational purposes. For example, you can set an automatic expiration time for the client-principal object (and the client login session it controls). You cannot use the resulting client-principal object to assert a user identity until you seal the object using the
SEAL( )method (see Table 2–4). Whether you set them all or not, the client-principal object attributes become read-only once you have sealed the object.For a given client-principal object, OpenEdge sets the read-only values of several attributes on behalf of the application, according to client-principal object method calls and other actions. Table 2–2 describes these attributes, listed in general usage order. For more information how these attributes are set, see Table 2–3 and Table 2–4.
Before sealing a client-principal object that you have created, you must set several OpenEdge-required attributes and several optional attributes, depending on your application requirements, as described and listed in Table 2–3 in general usage order. These settings are all application defined. Unless otherwise noted, these attributes hold
CHARACTERvalues. All references to a “user” indicate the user associated with the user ID that this client-principal object represents.
Table 2–3: Client-principal object attributes you can set This attribute... Sets this value... Required attributes (Required) A value to uniquely identify the client login session for the user represented by the client-principal object. You must set this value before sealing the object (logging in the client session).You can set this to any value, but you might want to ensure that the value is unique in case you use it as a reference to distinguish it among multiple client login sessions. To obtain a unique value, you can use the 4GLGENERATE-UUIDfunction (see the "Creating and managing unique object identities" section).If you want to associate the login session with a local AppServer session, you can also use theSERVER-CONNECTION-IDattribute on theSESSIONsystem handle to obtain a value. For more information on when you might do this, see the "Managing application user IDs in n-tier applications" section. (Required) The authenticated user ID of the user represented by this client-principal object. You must set this value before sealing the object (logging in the client session).Note: For validation purposes, it is up to you to ensure that theDOMAIN-NAMEattribute is also set to the name of the authentication system (domain) that you actually used to authenticate this user ID. (Required) The name of the authentication system (domain) used to authenticate the user ID specified by theUSER-IDattribute. This is a logical name that represents the 4GL code that handles the actual authentication of the user ID. You must set this value before sealing the object (logging in the client session). To be used for validating and setting user identities, this value must be identical to one of the following:Note: It is up to you to ensure that the domain name you specify actually corresponds to the authentication system that you used to authenticate the user ID.
- The Name field setting for a domain entry created in a connected-database trusted domain registry using the Authentication System Domains dialog box in Data Administration (see the Data Administration online help).
- The
domain-nameparameter set for a domain entry created in the application trusted domain registry using theREGISTER-DOMAIN( )method of theSECURITY-POLICYsystem handle (see the "Managing Progress session IDs" section.) Optional attributes A description of the authentication system (domain) used to authenticate the user’s ID. The type of the authentication system (domain) used to authenticate the user’s ID. ADATETIME-TZvalue that specifies when the client-principal object (and any login session started with it) expires. When Progress detects that the specified time has passed, it sets theLOGIN-STATEattribute to"EXPIRED"and the client-principal object becomes unusable for validation and any started client login session for the object ends. If you do not set this value, Progress ignores it and leaves it set to the Unknown value (?). When auditing is enabled, an application-defined value that is stored in the_Event-contextfield of each audit event record generated by a client-principal objectSEAL( ),LOGOUT( ), orAUTHENTICATION-FAILED( )method. The name of the terminal display for the user’s login session. The name of the host workstation on which the user is working. The name of the host workstation on which the user is working. A comma-separated string of authentication domain roles for the user ID associated with this object.
Client-principal object methods
After you create a client principal object, you can set and read any number of application-defined properties using methods on the object handle. After all attributes and properties have been set, you can invoke additional methods to start and manage a client login session. Table 2–4 describes the methods that you can invoke on a client-principal object, listed in general usage order. For more information on managing client login sessions with these methods, see the "Managing client login sessions" section.
Table 2–4: Client-principal object methods This method... Provides this function... Property set and get methods Defines a property in the client-principal object with a name (property-name) specified by a quoted string and a value specified by a character expression (property-value). You can call this method only once for each property you define in the object. Returns a comma-separated list of all application-defined properties set using theSET-PROPERTY( )method. Given the name of an application-defined property (property-name, expressed as a quoted string), returns the value assigned to that property using theSET-PROPERTY( )method. Login session management methods Indicates that the user ID associated with an unsealed client-principal object cannot be authenticated. After calling this method, the client-principal object is invalidated, its attributes and properties cannot be changed, and the object cannot be sealed.Calling this method also sets theLOGIN-STATEattribute to"FAILED"and writes the value of any character expression you provide for thereasonparameter to theSTATE-DETAILattribute.If auditing is enabled and auditing policies permit, the method generates an audit event record to indicate a user login failure. Given a character expression (key), indicates that the user ID associated with an unsealed client-principal object has successfully logged into its client login session. This method also generates an optional client login session record in connected databases. Before calling this method, all of the required attributes must be set (see Table 2–3).Calling this method seals the client-principal object so you cannot set any new or existing attributes or properties for the object. It also generates a digital seal that is stored with the object in the form of a message authentication code (MAC), which is based on the value ofkeyand the contents of the object. This seal is used to validate the client-principal object before setting user identities with it. To generate a validating seal, you must ensure that the value ofkeyis identical to the access code/domain key of an authentication domain stored in a trusted domain registry (see the "Managing client login sessions" section).Calling this method also sets theSEAL-TIMESTAMPattribute and checks the value of theLOGIN-EXPIRATION-TIMESTAMPattribute (see Table 2–3). If the client-principal object has expired, Progress sets theLOGIN-STATEattribute to"EXPIRED". Otherwise, it sets the attribute to"LOGIN".If auditing is enabled and auditing policies permit, the method generates an audit event record, along with any optional client login session record, to indicate a valid user login.After calling this method, you can use the client-principal object to assert and validate user identities using theSET-DB-CLIENTfunction or theSET-CLIENT( )method on theSECURITY-POLICYsystem handle. Converts and returns a sealed (logged in) client-principal object, including all of its attribute and property settings, as aRAWvalue. You can then store this value or pass it as a parameter to an AppServer session to set another client-principal object using theIMPORT-PRINCIPALmethod. Thus, this method allows you to transport the user identity represented by a client-principal object from one 4GL session to another. Given aRAWexpressionthat represents a sealed client-principal object (as output from theEXPORT-PRINCIPAL( )method), sets a target client-principal object to the contents and state of the sealed and exported client-principal object. You can then use the new sealed client-principal object to set user identities using theSET-DB-CLIENTfunction or theSET-CLIENT( )method on theSECURITY-POLICYsystem handle. Validates the MAC seal generated for a client-principal object by theSEAL( )method. To call this method on a sealed client-principal object, theLOGIN-STATEattribute must be set to"LOGIN". You typically validate the seal on client-principal object after you have imported it (using theIMPORT-PRINCIPAL( )method) from some external storage that is beyond the exclusive control of your application or whose integrity is otherwise questionable. To successfully validate the seal, you must provide the method with an access code/domain key value in one of the following ways:
- Pass it a parameter (
key) whose value is identical to the key value used to seal the object.- Ensure that the application trusted domain registry contains an entry for the authentication domain defined for the client-principal object (
DOMAIN-NAMEattribute) and that the entry includes an access code whose value is identical to the key value used to seal the object. (see the "Managing Progress session IDs" section.)Calling this method also checks the value of theLOGIN-EXPIRATION-TIMESTAMPattribute (see Table 2–3). If the client-principal object has expired, Progress sets theLOGIN-STATEattribute to"EXPIRED". Indicates that the user ID associated with a sealed client-principal object has logged out of its client login session. After calling this method, the client-principal object is invalidated, its attributes and properties cannot be changed, and the object cannot be sealed.Calling this method also sets theLOGIN-STATEattribute to"LOGOUT".If auditing is enabled and auditing policies permit, the method generates an audit event record to indicate a user logout.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |